/*
* QNX License:
* Copyright 2010, QNX Software Systems. All Rights Reserved.
*
* You must obtain a written license from and pay applicable license fees to QNX
* Software Systems before you may reproduce, modify or distribute this software,
* or any work that includes all or part of this software.   Free development
* licenses are available for evaluation and non-commercial purposes.  For more
* information visit http://licensing.qnx.com or email licensing@qnx.com.
*
* This file may contain contributions from others.  Please review this entire
* file for other proprietary rights or license notices, as well as the QNX
* Development Suite License Guide at http://licensing.qnx.com/license-guide/
* for other information.
*/
package views 
{
	import flash.display.MovieClip;
	
	
	
	/**
	 * @private
	 * The UIView class is the base class for all views that are controlled by the <code>NavController</code>.
	 * 
	 * @see qnx.views.NavController
	 * @see qnx.views.UIViewStates
	 */
	public class UIView extends MovieClip implements IView {
		
		/** @private **/
		protected var __state:String;
		
		
		/**
		 * Creates a new UIView instance.
		 */
		
		public function UIView() {
			super();
			
			//trace("UIView.__constructor");
		}
		
		public function set state(stateStr:String):void
		{
			//trace("UIView.state >>"+stateStr);
			setState(stateStr);	
		}
		
		/**
		 * Gets or sets the current state of the view.
		 */
		
		public function get state():String
		{
			return(__state);
		}
		/** @private **/
		public function setState(stateStr:String):void
		{
			
			//trace("UIView.setState(stateStr) >>"+stateStr);
			__state = stateStr;
			
			switch(__state)
			{
				
				case UIViewStates.ANIMATION_IN_COMPLETE:
					onAnimationInComplete();
					break;
				case UIViewStates.ANIMATION_IN_START:
					onAnimationInStart();
					break;
				case UIViewStates.ANIMATION_OUT_COMPLETE:
					onAnimationOutComplete();
					break;
				case UIViewStates.ANIMATION_OUT_START:
					onAnimationOutStart();
					break;
				
			}	
		}
		/** @private **/
		protected function onAnimationInComplete():void
		{
			//trace("UIView.onAnimationInComplete()");
		}
		/** @private **/
		protected function onAnimationInStart():void
		{
			//trace("UIView.onAnimationInStart()");
		}
		/** @private **/
		protected function onAnimationOutComplete():void
		{
			//trace("UIView.onAnimationOutComplete()");
		}
		/** @private **/
		protected function onAnimationOutStart():void
		{
			//trace("UIView.onAnimationOutStart()");
		}
		
	}
}